<?php
require(PUBLIC_PATH."header.php");
?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
         <div class="table-responsive">
          <h1 class="text-center">用户列表</h1>
          <a class="btn btn-primary btn-xs" <?php echo ' href="'.SITE_ROOT.'/admin.php?c=user&m=form"'; ?> role="button">添加</a>
            <table class="table table-striped table-hover">
                <tr>
                  <th>ID</th>
                  <th>用户名</th>
                  <th>密码</th>
                  <th>性别</th>
                  <th>生日</th>
                  <th>爱好</th>
                  <th>学历</th>
                  <th>简介</th>
                  <th width="35">头像</th>
                  <th>操作</th>
                </tr>
<?php  

                    foreach ($data['list'] as $one) {
                              echo '<tr>';
                              echo '<td>'.$one['uid'].'</td>';
                              echo '<td>'.$one['uname'].'</td>';
                              echo '<td>'.$one['password'].'</td>';
                              echo '<td>'.$one['gender'].'</td>';
                              echo '<td>'.$one['birthdate'].'</td>';
                              echo '<td>'.$one['hobby'].'</td>';
                              switch ($one['degree']) {
                                case '1':
                                  $dg='高中';
                                  break;
                                case '2':
                                  $dg='大学';
                                  break;
                                case '3':
                                  $dg='硕士';
                                  break;
                                case '4':
                                  $dg='博士';
                                  break;
                                default:
                                  $dg='未知';
                              }
                              echo'<td>'.$dg.'</td>';
                              echo '<td>'.$one['intro'].'</td>';
                              echo '<td align="center"><img src='.UserPhotoPath.$one['pic'].' width=60 height=80 alt="无头像"></td>';
                              echo '<td><a href="'.SITE_ROOT.'/admin.php?c=user&m=mod&id='.$one['uid'].'">修改</a>';
                              echo '|<a href="'.SITE_ROOT.'/admin.php?c=user&m=delete&id='.$one['uid'].'">删除</a></td>';
                              echo "</tr>";
                    }
                 
                 $totalrows = count($data['list']);
                echo "<table align='center'><tr><td>共有{$totalrows}名用户</td></tr></table>";   
               ?>
               </table>
               <div>
               <div>
<?php  
require(PUBLIC_PATH."footer.php");

?>